package com.baizhi.controller;

import com.baizhi.entity.User;
import com.baizhi.service.UserService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/page")
    public PageInfo<User> getPageInfo(@RequestParam(defaultValue = "1") Integer pageNum){
        System.out.println("pageNum="+pageNum);
        return userService.getUsersPageInfo(pageNum,10);
    }
}
